﻿using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;

namespace MetroManagement.EntityFrameworkCore
{
    /// <summary>
    /// 地铁管理数据上下文
    /// </summary>
    [ConnectionStringName("MetroManagement")]
    public class MetroManagementDbContext : AbpDbContext<MetroManagementDbContext>, IMetroManagementDbContext
    {
        public DbSet<Card> Cards { get; set; }


        public DbSet<Notice> Notices { get; set; }
        public DbSet<Statement> Statements { get; set; }


        public DbSet<Found> Founds { get; set; }


        public DbSet<City> Cities { get; set; }
        public DbSet<Line> Lines { get; set; }
        public DbSet<Station> Stations { get; set; }
        public DbSet<LineStation> LineStations { get; set; }


        public DbSet<Record> Records { get; set; }

        public MetroManagementDbContext(DbContextOptions<MetroManagementDbContext> options)
            : base(options)
        {
        }

        protected override void OnModelCreating(ModelBuilder builder)
        {
            base.OnModelCreating(builder);
            builder.ConfigureMetroManagement();
        }
    }
}